home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98b.txt / 000084_icon-group-sender _Mon Jun 15 08:24:33 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id IAA17293
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 15 Jun 1998 08:24:32 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA18164; Mon, 15 Jun 1998 08:24:23 -0700
  7. From: shamim@Synopsys.COM (Shamim Zvonko Mohamed)
  8. Message-Id: <9806150114.AA18119@bermuda.synopsys.com>
  9. Subject: Re: Directory access facilities
  10. To: jeffery@cs.utsa.edu
  11. Date: Sun, 14 Jun 1998 18:14:18 -0700 (PDT)
  12. Cc: ok@atlas.otago.ac.nz, abrahams@acm.org, icon-group@optima.CS.Arizona.EDU
  13. In-Reply-To: <199806020443.XAA08820@segfault.cs.utsa.edu> from "Clinton Jeffery" at Jun 1, 98 11:43:37 pm
  14. X-Mailer: ELM [version 2.4 PL24]
  15. Mime-Version: 1.0
  16. Content-Type: text/plain; charset=US-ASCII
  17. Content-Transfer-Encoding: 7bit
  18. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  19. Status: RO
  20. Content-Length: 1112
  21.  
  22. Clint writes:
  23.  
  24. > Anyone else have ideas (or votes) on how to do directory access
  25. > facilities?
  26.  
  27. My admittedly biased and possibly Unix-centric view: we don't need any
  28. elaborate solutions, I think the idea of each read() returning one entry
  29. from the directory is the best one. This finesses all the issues of quoting
  30. blanks, quotes, wildchars etc. etc. If you need more information about the
  31. entry, you use the function that performs this query. In Unicon, you use
  32. stat(), which returns a record. Here's the "ls" example:
  33.  
  34.    f := open(".") | stop( ... )
  35.    while write( format( stat( read(f) ) ) )
  36.  
  37. (For clarity I left out some pretty features like sorting the names, and
  38. that you'd want to use lstat instead of stat, etc. Look at the Unicon docs
  39. for more info.)
  40.  
  41. Someone wanted a directory to be like a table. Yes, a directory is a
  42. "lookup" type of object but not on all systems. We should stick to a clean
  43. and simple interface that will work unambiguously without all sorts of
  44. special cases. Others have already pointed out why a space-separated
  45. string of all the entries is a bad idea.
  46.  
  47. -s
  48.  
  49. Shamim Mohamed
  50.  
  51.  
  52.